package org.dandelion.papercheck.service.impl;

import org.dandelion.papercheck.service.WeightService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class WeightServiceImp implements WeightService {
    @Override
    public Map<String, Integer> getWeightMap(List<String> wordList) {
        var map = new HashMap<String, Integer>();
        for (var s : wordList) {
            map.merge(s, 1, Integer::sum);
        }
        return map;
    }
}
